package com.jeesite.modules.kj.api.vo.response;

import com.jeesite.modules.kj.api.vo.responseVo.base.BaseResponseVo;
import com.jeesite.modules.kj.entity.KjBadge;
import com.jeesite.modules.kj.entity.KjMemberBadge;
import com.jeesite.modules.kj.entity.KjMemberIntegrals;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.Date;

@Data
public class MemberBadgeResponseVo extends BaseResponseVo<KjMemberBadge> {
    @ApiModelProperty(value = "积分ID")
    private String id;
    @ApiModelProperty(value = "用户ID")
    private String memberId;
    @ApiModelProperty(value = "用户名")
    private String memberName;
    @ApiModelProperty(value = "徽章ID")
    private String badgeId;
    @ApiModelProperty(value = "徽章名")
    private String badgeName;
    @ApiModelProperty(value = "徽章图")
    private String badgeImg;
    @ApiModelProperty(value = "获得时间")
    private Date gatherTime;

    @ApiModelProperty(value = "是否已读")
    private String isView;

    public MemberBadgeResponseVo() {
    }

    @Override
    public void setEntity(KjMemberBadge entity) {
        BeanUtils.copyProperties(entity, this);
        if(entity.getKjBadge() != null) {
            KjBadge b = entity.getKjBadge();
            this.badgeId = b.getId();
            this.badgeName = b.getName();
            this.badgeImg = b.getImg();
        }
    }

    public MemberBadgeResponseVo(KjMemberBadge entity) {
        setEntity(entity);
    }
}
